package com.ch.forum.bo;

public class PageResult {

    private int pageNo;

    private int pageSize;

    private int totalRecords;

    private int totalPages;

    private Object records;

    public PageResult() {
    }

    public PageResult(int pageNo, int pageSize, int totalRecords, Object records){
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.totalRecords = totalRecords;
        this.records = records;
        this.totalPages = totalRecords%pageSize == 0 ? totalRecords/pageSize : totalRecords/pageSize + 1;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalRecords() {
        return totalRecords;
    }

    public void setTotalRecords(int totalRecords) {
        this.totalRecords = totalRecords;
    }

    public Object getRecords() {
        return records;
    }

    public void setRecords(Object records) {
        this.records = records;
    }

    public int getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }
}
